package com.amumu.drama.common.modules.message.service;

import com.amumu.drama.common.modules.order.service.OmsPortalOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 取消订单消息的接收者
 * Created by macro on 2018/9/14.
 */
@Component
//@RabbitListener(queues = "mall.order.cancel")
public class CancelOrderReceiver {
    private static final Logger LOGGER = LoggerFactory.getLogger(CancelOrderReceiver.class);
    @Autowired
    private OmsPortalOrderService portalOrderService;

    //    @RabbitHandler
    public void handle(Long orderId) {
        portalOrderService.cancelOrder(orderId, null);
        LOGGER.info("process orderId:{}", orderId);
    }
}
